package com.lihui.reversestr;


import java.util.Scanner;

/**
 * 功能描述
 *
 * @author wileda
 * @date 2022/11/22  16:22
 */
public class ReverseStr {
    public static void main(String[] args) {
        Scanner  sc = new Scanner(System.in);
        while(sc.hasNext()){
            String str = sc.nextLine();
            reverse(str);
        }
    }

    private static void reverse(String str) {
        //由于输入由空格隔开，所有使用split函数以空格为条件，隔开
        String[] arr = str.split(" ");
        //遍历这个String类型的数组，倒序输出即可
        for (int i = arr.length - 1; i >= 0; i--) {
            System.out.print(arr[i] + " ");
        }
    }
}
